// ExamServer.h : main header file for the PROJECT_NAME application
//

#pragma once

#ifndef __AFXWIN_H__
    #error "include 'stdafx.h' before including this file for PCH"
#endif

#include "resource.h"        // main symbols


// CExamServerApp:
// See ExamServer.cpp for the implementation of this class
//

class CExamServerApp : public CWinApp
{
public:
    CExamServerApp();

// Overrides
    public:
    virtual BOOL InitInstance();

// Implementation

    DECLARE_MESSAGE_MAP()
};

extern CExamServerApp theApp;
extern CString theProgramPath;

#include "SettingWindow.h"
extern CSettingWindow theSetting;


#ifdef _UNICODE
#define StringSymble _T("%s")
#else
#define StringSymble _T("%S")
#endif

#ifdef _UNICODE
#define StringSymble2 _T("%S")
#else
#define StringSymble2 _T("%s")
#endif

#include "Poco\UnicodeConverter.h"
#include <string>
#include <atlconv.h>

inline void Utf8String2CString(CString &cstr, const std::string &ustr)
{
    std::wstring wstr;
    Poco::UnicodeConverter::toUTF16(ustr, wstr);
    cstr.Format(StringSymble, wstr.c_str());
}

inline void CString2Utf8String(std::string &ustr, CString &cstr)
{
    USES_CONVERSION;
    Poco::UnicodeConverter::toUTF8(T2W(cstr.GetBuffer()), ustr);
}